package com.dqx.opengl_es_demo.face;

import android.os.Bundle;
import android.widget.SeekBar;

import com.dqx.opengl_es_demo.BaseActivity;
import com.dqx.opengl_es_demo.R;

/**
 * 脸部检测
 */
public class FaceDetectionActivity extends BaseActivity implements
        BaseActivity.OnPermissionsListener {
    SeekBar seekBarA;
    SeekBar seekBarB;
    SeekBar seekBarC;

    FaceDetectionSurfaceView surfaceView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_face_detection);
        surfaceView = findViewById(R.id.surface_view);
        surfaceView = findViewById(R.id.surface_view);
        seekBarA = findViewById(R.id.seek_bar_a);
        seekBarB = findViewById(R.id.seek_bar_b);
        seekBarC = findViewById(R.id.seek_bar_c);

        //设置饱和度
        surfaceView.setS(seekBarA.getProgress() / 100.0f);
        //设置色调
        surfaceView.setH(seekBarB.getProgress() / 360.0f);
        //亮度
        surfaceView.setL(seekBarC.getProgress() / 100.0f - 1);

        //请求相机和文档读写权限
        requestPermissions(this);
    }

    @Override
    public void onSuccess() {

    }

    @Override
    public void onFailure() {

    }
}
